package com.bingbing.back.controller;

import com.bingbing.back.dto.ConsultInfoDto;
import com.bingbing.back.po.ConsultInfo;
import com.bingbing.back.service.ConsultInfoService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/consult")
public class ConsultInfoController {
    @Resource
    private ConsultInfoService consultInfoService;
    //根据输入的条件查询信息
    @RequestMapping("/findByParam")
    public PageInfo<ConsultInfo> findByParam(int pageNum, int pageSize, ConsultInfoDto dto){
        PageInfo<ConsultInfo> page=null;
        page=consultInfoService.findByParam(pageNum,pageSize,dto);
        return page;
    }
    //调用stuInfoMapper下的方法查询某咨询师对接的学生个数
    @RequestMapping("/dofindByConsultId")
    public int dofindByConsultId(Integer consultId){
        Integer row=0;
        row=consultInfoService.dofindByConsultId(consultId);
        return row;
    }
    //根据咨询师账号删除
    @RequestMapping("/doDelete")
    public int doDelete(Integer consultId){
        Integer row=0;
        row=consultInfoService.doDelete(consultId);
        return row;
    }

}
